package Utils;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

/**
 * Description: 随机数生成
 *
 * @Autor: Rolin
 * datetime: 06-08-22:16
 */
public class RandomProducer {

    public static Map<String, Object> produceFourBitRandom() {
        Map<String, Object> map = new HashMap<>();
        Random random = new Random();
        String add = "";
        for (int i = 0; i < 4; i++) {
            Integer num = random.nextInt(10);
            add += String.valueOf(num);
        }
        map.put("code",add);
        return map;
    }

    public static Map<String, Object> produceSixBitRandom() {
        Map<String, Object> map = new HashMap<>();
        Random random = new Random();
        String add = "";
        for (int i = 0; i < 6; i++) {
            Integer num = random.nextInt(10);
            add += String.valueOf(num);
        }
        map.put("code",add);
        return map;
    }
}
